home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Utilities / MUIPictureCat / Install < prev    next >
Encoding:
Text File  |  2001-05-24  |  3.6 KB  |  129 lines

  1. ; $VER: Installation script for MUIPictureCatalog 1.0 (01. April 2000)
  2. ; © Michael Merkel
  3. ; Created with GoldED 6.15
  4.  
  5.  
  6. ; -----------------------------------------------------------------------------
  7. ; some default values...
  8.  
  9. (set #prgname        "MUIPictureCatalog")                    ; program name.
  10. (set #dest            "PageStream:Scripts")                    ; path for installation
  11. (set #readme        (cat #prgname ".readme"))                ; ReadME Datei
  12.  
  13. (set @default-dest #dest)
  14.  
  15. ; -----------------------------------------------------------------------------
  16. ; check if we are running under correct OS
  17. (if (< (/ (getversion) 65536) 39)
  18.     (
  19.         (abort "Incorrect OS version (software requires OS 39 or better )!")
  20.     )
  21. )
  22.  
  23. ; -----------------------------------------------------------------------------
  24. ; error handling
  25. (onerror
  26.     (if (> @ioerr 0)
  27.         (
  28.             (message
  29.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  30.             )
  31.         )
  32.     )
  33.     (exit (quiet))
  34. )
  35.  
  36. ; -----------------------------------------------------------------------------
  37. ; set installation mode
  38. (set #installmode
  39.     (askbool
  40.         (prompt "Choose the installation mode:")
  41.         (help @askbool-help)
  42.         (choices
  43.             "Install"
  44.             "Uninstall"
  45.         )
  46.         (default 1)
  47.     )
  48. )
  49.  
  50. (if (= #installmode 1)
  51. ; -----------------------------------------------------------------------------
  52. ;     normal installation
  53.     (
  54.         (welcome)
  55.         ; --- insert your code below ---
  56.         (message "Welcome to the installation of " #prgname "\n")
  57.         (set #dest
  58.             (askdir
  59.                 (prompt ("Where should \"%s\" be installed?\nA directory called \"%s\" will be created there" #prgname #prgname))
  60.                 (help @askdir-help)
  61.                 (default @default-dest)
  62.             )
  63.         )
  64.         (set #dest     (tackon #dest #prgname))
  65.         (set @default-dest #dest)
  66.  
  67.         (if (exists #dest (noreq))
  68.             (message #prgname " will be installed in the path"
  69.                      "\n\n\"" #dest "\"\n")
  70.  
  71.             (
  72.                 (message #prgname " will be installed in the path"
  73.                          "\n\n\"" #dest "\"\n"
  74.                          "\nA new directory will be created")
  75.                 (makedir #dest (infos))
  76.             )
  77.         )
  78.  
  79.         (set #prog_path        (cat (tackon #dest #prgname) ".rexx"))
  80.         (set #msg_inst        (cat ("\"%s\" is now installed in \"%s\".\n" #prgname #dest)
  81.                             " If you want to use this script inside PageStreams script palette"
  82.                             " you have to do it in this way:\n\n"
  83.                             "1. open the script palette\n"
  84.                             "2. select NEW from the script palette menu\n"
  85.                             ("3. insert a name for the entry (like %s)\n" #prgname)
  86.                             "4. in the SCRIPT field enter:\n"
  87.                             ("        rx \"%s\"\n" #prog_path)
  88.                             "   and press OK\n"
  89.                             "5. select SAVE from the scrip palette menu\n"))
  90.  
  91.         (if (exists #prog_path (noreq))
  92.             (
  93.                 (set     #goon
  94.                         (askbool (prompt "Script already installed. Do you want to install it anyway?")
  95.                                  (help "This will overwrite the script AND the default prefs file!"))
  96.                 )
  97.                 (if (= #goon 0)
  98.                     (exit "Installation cancelled. Script already installed." (quiet))
  99.                 )
  100.             )
  101.         )
  102.  
  103.         (copyfiles
  104.             (source "")
  105.             (dest   #dest)
  106.             (infos)
  107.             (files)
  108.             (pattern "~(Install#?|PGSScriptPathUpdater)")
  109.         )
  110.         (set #pathUpdater ("pgsScriptPathUpdater \"%s.rexx\" \"%s/%s.rexx\" \"%s\" \"pgsInstallDir =\"" #prgname #dest #prgname #dest))
  111. ;        (message "command:\n" #pathUpdater "")
  112.         (run #pathUpdater)
  113.         (message #msg_inst)
  114.  
  115.         ; --- end of your code ---
  116.         (exit)
  117.     )
  118.  
  119. ; -----------------------------------------------------------------------------
  120. ;     uninstall application
  121.     (
  122.         ; --- insert your code below ---
  123.         ; -- end of your code ---
  124.  
  125.         (message "Uninstallation completed.")
  126.         (exit (quiet))
  127.     )
  128. )
  129.